package com.dmall.framework.result;

/**
 * @author Chen  2017/8/26
 */
public class SearchParam {
    private int page = 1;//第几页
    private int rows = 10;//一页有多少行
    private String order;//排序方式 asc升序、desc降序
    private String sort;//排序的列


    public SearchParam() {
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        if(page < 1) {
            throw new IllegalArgumentException("page 参数不能小于 1。");
        } else {
            this.page = page;
        }
    }

    public int getRows() {
        return rows;
    }

    public void setRows(int rows) {
        if(rows < 0) {
            throw new IllegalArgumentException("pageSize 参数不能小于 0。");
        } else {
            this.rows = rows;
        }
    }

    public String getOrder() {
        return order;
    }

    public void setOrder(String order) {
        this.order = order;
    }

    public String getSort() {
        return sort;
    }

    public void setSort(String sort) {
        this.sort = sort;
    }
}
